using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class PKT_BillsMap : EntityTypeConfiguration<PKT_Bills>
    {
        public PKT_BillsMap()
        {
            // Primary Key
            this.HasKey(t => new { t.spid, t.id });

            // Properties
            this.Property(t => t.spid)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.Patient_ID)
                .HasMaxLength(20);

            this.Property(t => t.Patient_Case_)
                .HasMaxLength(20);

            this.Property(t => t.Patient_Latin)
                .HasMaxLength(50);

            this.Property(t => t.Patient_Arabic)
                .HasMaxLength(50);

            this.Property(t => t.Bill__)
                .HasMaxLength(20);

            this.Property(t => t.UserName)
                .HasMaxLength(30);

            this.Property(t => t.Attending_physician)
                .HasMaxLength(50);

            this.Property(t => t.Attending_physician_id)
                .HasMaxLength(20);

            this.Property(t => t.Currency)
                .HasMaxLength(20);

            this.Property(t => t.Guarantor1)
                .HasMaxLength(50);

            this.Property(t => t.Guarantor2)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("PKT_Bills");
            this.Property(t => t.spid).HasColumnName("spid");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.Patient_ID).HasColumnName("Patient_ID");
            this.Property(t => t.Patient_Case_).HasColumnName("Patient_Case#");
            this.Property(t => t.Patient_Latin).HasColumnName("Patient_Latin");
            this.Property(t => t.Patient_Arabic).HasColumnName("Patient_Arabic");
            this.Property(t => t.Bill__).HasColumnName("Bill_#");
            this.Property(t => t.UserName).HasColumnName("UserName");
            this.Property(t => t.Date).HasColumnName("Date");
            this.Property(t => t.Attending_physician).HasColumnName("Attending_physician");
            this.Property(t => t.Attending_physician_id).HasColumnName("Attending_physician_id");
            this.Property(t => t.Currency).HasColumnName("Currency");
            this.Property(t => t.Bill_Total).HasColumnName("Bill_Total");
            this.Property(t => t.Payments).HasColumnName("Payments");
            this.Property(t => t.Bill_Balance).HasColumnName("Bill_Balance");
            this.Property(t => t.Patient_Due).HasColumnName("Patient_Due");
            this.Property(t => t.Patient_Payments).HasColumnName("Patient_Payments");
            this.Property(t => t.Patient_Bill_Balance).HasColumnName("Patient_Bill_Balance");
            this.Property(t => t.Guar1_Due).HasColumnName("Guar1_Due");
            this.Property(t => t.Guar2_Due).HasColumnName("Guar2_Due");
            this.Property(t => t.Guarantor1).HasColumnName("Guarantor1");
            this.Property(t => t.Guarantor2).HasColumnName("Guarantor2");
            this.Property(t => t.Bill_Amount).HasColumnName("Bill_Amount");
            this.Property(t => t.Discount_Percentage).HasColumnName("Discount_Percentage");
            this.Property(t => t.Discount_Amount).HasColumnName("Discount_Amount");
        }
    }
}
